/**
 * * @author Liujing 
 * last changing time 2013.4.28 21:35
 */
package arraylist;

public class Student implements Comparable {
	/**
	 * @version 2.0 28th April 2013
	 */

	private int stu_no;
	private String name;
	private int age;

	public int getStu_no() {
		return stu_no;
	}

	public void setStu_no(int stu_no) {
		this.stu_no = stu_no;
	}

	public Student(int sn, String n, int a) {
		this.stu_no = sn;
		this.name = n;
		this.age = a;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public int getAge() {
		return age;
	}

	public void setAge(int age) {
		this.age = age;
	}

	public String toString() {
		return this.name + " " + this.stu_no + " " + this.age;
	}

	/*
	 * Used to compare and sort students by its name using the lexicographical
	 * order
	 */
	public int compareTo(Object s) {
		// TODO Auto-generated method stub
		return this.name.compareTo(((Student) s).name);
	}
}